package com.teemor.common.bean.base;

import lombok.Data;

import java.util.List;

/**
 * @Description:
 * @author zhoulk
 * @date: 2020/3/7
 */
@Data
public class PageBean<T> {

    private List<T> values;

    private Integer total;

    public static <V> PageBean<V> create(List<V> vList, Integer total, Class<V> clazz) {
        PageBean<V> pageBean = new PageBean<>();
        pageBean.setValues(vList);
        pageBean.setTotal(total);
        return pageBean;
    }
    public static <V> PageBean<V> create(List<V> vList,  Class<V> clazz) {
        PageBean<V> pageBean = new PageBean<>();
        pageBean.setValues(vList);
        pageBean.setTotal(-1);
        return pageBean;
    }
}
